package com.example.lt.controller;

import com.example.lt.pojo.entity.Banner;
import com.example.lt.result.Result;
import com.example.lt.service.BannerService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author 小涛Tao
 * @Date: 2024/05/30/19:41
 * version 1.0 注释：
 **/
@Slf4j
@RestController
@RequiredArgsConstructor
@RequestMapping("/banner")
public class BannerController {

    private final BannerService bannerService;

    /**
     * 获取所有轮播图
     * @return
     */
    @GetMapping("/common/getAllBanner")
    public Result<List<Banner>> getAllBanner(){
        log.info("获取所有轮播图");
        List<Banner> bannerList = bannerService.getAllBanner();
        return Result.success("获取成功", bannerList);
    }

}
